﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HZ.MBSM.BLL;
using Grove.ORM;
using HZ.MBSM.Model;
using HZ.MBSM.DBUtility;

public partial class Company_ProjectList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

        if (HZ.MBSM.BLL.Login.CheckAssert(this.UseAccountType))
        {
            HZ.MBSM.Model.Account _Account = (HZ.MBSM.Model.Account)Session["Account"];
            if (_Account != null)
            {
                Int64 AccountId_TBR;
                System.Data.IDataReader dr;
                string check = "";
                string sql = "";
                AccountId_TBR = SysFun.ToLong(_Account.AccountId);
                Db db = new Db();

                //如果审核未通过，弹出未通过审核的药品

                sql = "select count(*) as cun from company where (CheckStatus='2' or isnull(checkstatus,0) ='0') and accountid=" + AccountId_TBR.ToString();

                dr = db.DataReader(sql);
                while (dr.Read())
                {
                    check = dr["cun"].ToString();
                }
                dr.Close();
                dr.Dispose();
                db.Close();
                if (check != "0")
                    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "openwin", "<script>GB_showCenter('系统提示','../../bidder/ComNoPass.aspx',400,600)</script>");
                else if (check == "0")
                {
                    GetProjectData();
                }

            }
        }
    }

    public void GetProjectData()
    {
        AgencyBiding Agb = new AgencyBiding();
        DataTable dt = Agb.GetBidProjectDataTable();
        GridView1.DataSource = dt.DefaultView;
        GridView1.DataBind();
        dt.Dispose();
    }

    #region IPageDescribe 成员


    public string Describe
    {
        get { return "招标项目列表"; }
    }
    public string Name
    {
        get { return "招标项目列表"; }
    }
    public string ParentName
    {
        get { return "招标项目列表"; }
    }

    public System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> UseAccountType
    {
        get
        {
            System.Collections.Generic.List<HZ.MBSM.DAL.AccountType> _AccountType = new System.Collections.Generic.List<HZ.MBSM.DAL.AccountType>();
            _AccountType.Add(HZ.MBSM.DAL.AccountType.enumCompany);
            return _AccountType;
        }
    }

    #endregion
}